package com.it.service;

import com.it.dao.UserDaoImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.xml.namespace.QName;

/***
 * 在注解里面value属性值可以省略不写，
 * 默认值是类名称，首字母小写
 * UserService---->userService
 */
@Service
public class UserService {
//  @Autowired
//    @Qualifier(value="userDaoImpl")
    @Value(value = "abc")
    private String name;
 @Resource
    private UserDaoImpl userDao;
    public  void add(){
        System.out.println("service add....");
        userDao.add();
        System.out.println("name:"+name);
    }
}
